﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SES.CMS.BL;
using SES.CMS.DO;
using System.IO;

namespace SES.CMS.Module
{
    public partial class ucProductSlide : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
            {
                int sanPhamID = int.Parse(Request.QueryString["ID"].ToString());
                DataTable dtSanPham = new cmsSanPhamBL().SelectBySanPhamID(sanPhamID);
                if (dtSanPham.Rows.Count > 0)
                {
                    
                    hplImg.NavigateUrl = "/Media/" + dtSanPham.Rows[0]["HinhAnh"].ToString();
                    imgContent.ImageUrl = "/Media/" + dtSanPham.Rows[0]["HinhAnh"].ToString();
                    rptMainImageDatasource(sanPhamID);
                }
            }
        }

        protected void rptMainImageDatasource(int sanPhamID)
        {

            rpt2.DataSource = new cmsImagesBL().SelectBySanPhamID(sanPhamID);
            rpt2.DataBind();
        }
    }
}